Examples home
     
Example-1
Scan directory "c:\in" (and all subdirectories) every 10 seconds and move all ".txt" files to directory "c:\out".
Scan Interval 10
Stable Timer 20
Description Move files from IN to OUT
Scan Directory C:\IN
Include Subdirectories On
Single File Handling Off
Filter .txt
Reject <blank>
Preset Local Variables to Not important
Local Constants
Local-Constant-1 C:\OUT
CommandScript

On Error

<blank>

External Command RunState

Not important

.

<CreateDir> <LC1>\<SubDir> make sure the output directory-tree exists
<MoveFile> <ScanPathFileName> <LC1>\<SubDir>\<FileName> move the file
     
Example-2
Purge every day at 04:00 all files in directory "C:\Purge" that are older then 14-days.
Scan Interval 04:00
Stable Timer 20
Description Purge files in C:\Purge
Scan Directory C:\Purge
Include Subdirectories Off
Single File Handling Off
Filter *
Reject <blank>
Preset Local Variables to Not important
CommandScript

On Error

<blank>

External Command RunState

Not important

.

<PurgeFile> 14 <ScanPathFileName> remove (purge) all files older then 14-days
     
Example-3
Scan directory (including subdirectories) "C:\In" every 30 seconds for ".jpg" and ".tif" files, exclude and remove all other files. Move the files to "C:\Out" and make a copy of the files to "C:\Backup" in a "year/month/day" directory structure. Also keep track of the number of files processed by using a counter. When an error occurs, send a message to computer WNT001.
Scan Interval 30
Stable Timer 20
Description Move and Backup Graphic Files
Scan Directory C:\In
Include Subdirectories On
Single File Handling Off
Filter .jpg;.tif
Reject *
Remove Rejected On
Preset Local Variables to 0
Local Constants
Local-Constant-1 C:\Out
Local-Constant-2 C:\Backup
CommandScript

On Error

net send WNT001 ATTENTION: Error during FST script!

External Command RunState

Not important

.

<SetVariable> <Local> <1> <Add> <LV1> 1 this is the counter; <LV1>=<LV1>+1
<Echo> Processing file number : <LV1> message reporting number of file being processed
<CreateDir> <LC1>\<SubDir> make sure the output-directory tree exists
<CreateDir> <LC2>\<yyyy>\<mmm>\<dd> make sure the backup-directory (year\month\day format) tree exists
<CopyFile> <ScanPathFileName> <LC2>\<yyyy>\<mmm>\<dd>\<FileName> copy the file into the current-day directory of the backup-directory
<MoveFile> <ScanPathFileName> <LC1>\<SubDir>\<FileName> move the file from the scan-directory to the output-directory (LC1)
     

home